package com.example.tool.subject;

import com.example.tool.module.ModulePInformation;
import com.example.tool.ui.HToolIcon;
import com.intellij.ide.util.projectWizard.JavaModuleBuilder;
import com.intellij.ide.util.projectWizard.ModuleBuilder;
import com.intellij.ide.util.projectWizard.ModuleWizardStep;
import com.intellij.ide.util.projectWizard.SettingsStep;
import com.intellij.openapi.module.JavaModuleType;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import javax.swing.Icon;

/**
 * <p>Title: SubjectModuleBuilder</p >
 * Description: 自定义模块类型
 * <p>CreateTime: 2022/6/21 9:11</p>
 *
 * @author FT
 */
public class HToolModuleType extends JavaModuleType {
    private static final String MODULE_ID = ModulePInformation.MODULE_ID;
    private static final String MODULE_NAME = ModulePInformation.MODULE_NAME;
    private static final String MODULE_DESCRIPTION = ModulePInformation.MODULE_DESCRIPTION;

    public HToolModuleType() {
        this(MODULE_ID);
    }

    protected HToolModuleType(@NonNls String id) {
        super(id);
    }

    @Override
    public @Nullable ModuleWizardStep modifyProjectTypeStep(@NotNull SettingsStep settingsStep, @NotNull ModuleBuilder moduleBuilder) {
        return HToolModuleWizardStep.getInstance();
    }

    @Override
    public @NotNull String getName() {
        return MODULE_NAME;
    }

    @NotNull
    @Override
    public String getDescription() {
        return MODULE_DESCRIPTION;
    }


    @NotNull
    @Override
    public JavaModuleBuilder createModuleBuilder() {
        return HToolModuleBuilder.getInstance();
    }

    @Override
    @NotNull
    public Icon getNodeIcon(boolean isOpened) {
        return HToolIcon.ModuleTypeIcon;
    }
}